home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / linux / src / amcncsc.dgz / amicon-ecs.c.diff
Encoding:
Text File  |  1994-11-15  |  22.0 KB  |  705 lines

  1. *** amicon.c.orig    Sat Oct  1 06:39:00 1994
  2. --- amicon.c    Tue Nov 15 17:03:46 1994
  3. ***************
  4. *** 9,14 ****
  5. --- 9,22 ----
  6.   **          - 24-bit color palette
  7.   **      Modified 19-June-94 by Geert Uytterhoeven
  8.   **          - cursor flashing for better cursor visibility
  9. + **      Modified 18-August-94 by Jes Sorensen (jds@kom.auc.dk)
  10. + **          - ECS support. The following screen-modes are included:
  11. + **              multiscan, multiscan-lace, super72, super72-lace, dblntsc,
  12. + **              dblpal & euro72.
  13. + **            I suggest that we remove the old AGA screenmodes, as they are
  14. + **              non-standard, and some of them doesn't work under ECS.
  15. + **      Minor cleanup on 15-November-94, first release of the ECS-screenmodes.
  16. + **            (Jes)
  17.   **
  18.   **  Interface based on the original 'amicon.c' code:
  19.   **      Copyright (C) 1993 Hamish Macdonald and Greg Harp
  20. ***************
  21. *** 176,181 ****
  22. --- 184,191 ----
  23.       ushort diwstrt_v, diwstrt_h;   /* display window control */
  24.       ushort diwstop_v, diwstop_h;
  25.       ushort bplcon0;                /* display mode */
  26. +     ushort htotal;                 /* htotal is used to calc the pal-line, */
  27. +                                    /* though I don't know if it is right.  */
  28.   
  29.       ulong fgcol;               /* 24-bit text colors */
  30.       ulong bgcol;
  31. ***************
  32. *** 195,201 ****
  33.       ushort *coplist2dyn;   /* List 2 dynamic component */
  34.       };
  35.   
  36.   /* Geometry structure contains all useful information about given mode.
  37.    *
  38.    * Strictly speaking `scr_max_height' and `scr_max_width' is redundant
  39. --- 205,210 ----
  40. ***************
  41. *** 208,218 ****
  42.    * available, without confusing the poor chipset. OCS modes use only the
  43.    * bplcon0, diwstrt, diwstop, ddfstrt, ddfstop registers (a few others could
  44.    * be used as well). -wjr
  45.    */
  46. -  
  47.   struct geometry {
  48.       char *modename;    /* Name this thing */
  49. !     char isOCS;        /* Is it OCS or AGA */
  50.       ushort bplcon0;    /* Values for bit plane control register 0 */
  51.       ushort scr_width;
  52.       ushort scr_height;
  53. --- 217,230 ----
  54.    * available, without confusing the poor chipset. OCS modes use only the
  55.    * bplcon0, diwstrt, diwstop, ddfstrt, ddfstop registers (a few others could
  56.    * be used as well). -wjr
  57. +  *
  58. +  * The code now supports ECS aswell, except for FMODE all control registers
  59. +  * are the same under ECS. A special color-table has to be generated though.
  60. +  * -Jes
  61.    */
  62.   struct geometry {
  63.       char *modename;    /* Name this thing */
  64. !     char isOCS;        /* Is it OCS or ECS/AGA */
  65.       ushort bplcon0;    /* Values for bit plane control register 0 */
  66.       ushort scr_width;
  67.       ushort scr_height;
  68. ***************
  69. *** 264,269 ****
  70. --- 276,289 ----
  71.   static int do_unblank;
  72.   
  73.   /*
  74. +  * ecs_color_zero is used to keep custom.color[0] for the special ECS color-
  75. +  * table, as custom.color[0] is cleared at vblank interrupts.
  76. +  * -Jes (jds@kom.auc.dk)
  77. +  */
  78. + static ushort ecs_color_zero;
  79. + /*
  80.   ** Functions
  81.   */
  82.   
  83. ***************
  84. *** 347,352 ****
  85. --- 367,378 ----
  86.    * Wait(diwstop_h-2, 0xff) to make it work with the additional
  87.    * `get-all-you-can-get-out-of-it' AGA modes. Maybe we should derive the
  88.    * wait position from the HTOTAL value? - G.U.
  89. +  *
  90. +  * The Wait(diwstop_h-2, 0xff) didn't work in Super72 under ECS, instead
  91. +  * I changed it to Wait(htotal-4, 0xff). Dunno whether it works under AGA,
  92. +  * and don't ask my why it works. I'm trying to get some facts on this issue
  93. +  * from Commodore.
  94. +  * -Jes
  95.    */
  96.   
  97.   static __inline__ ushort *
  98. ***************
  99. *** 403,415 ****
  100.   
  101.       for (i = 0 ; i < p->scr_depth ; i++) {
  102.           scrmem    = ((long)p->bitplane[i]) + offset;
  103.           if (shf)
  104.               scrmem += p->bytes_per_row;
  105.   
  106.           *cop++ = CUSTOM_OFS(bplpt[i]);
  107. !         *cop++ = (long)scrmem >> 16;
  108.           *cop++ = CUSTOM_OFS(bplpt[i]) + 2;
  109. !         *cop++ = (long)scrmem;
  110.       }
  111.   
  112.       /* If wrapped frame needed - wait for line then switch bitplXs */
  113. --- 429,442 ----
  114.   
  115.       for (i = 0 ; i < p->scr_depth ; i++) {
  116.           scrmem    = ((long)p->bitplane[i]) + offset;
  117.           if (shf)
  118.               scrmem += p->bytes_per_row;
  119.   
  120.           *cop++ = CUSTOM_OFS(bplpt[i]);
  121. !         *cop++ = (long)(scrmem) >> 16;
  122.           *cop++ = CUSTOM_OFS(bplpt[i]) + 2;
  123. !         *cop++ = (long)(scrmem);
  124.       }
  125.   
  126.       /* If wrapped frame needed - wait for line then switch bitplXs */
  127. ***************
  128. *** 426,437 ****
  129. --- 453,483 ----
  130.           while (line > 256) {
  131.           /* Hardware limitation - 8 bit counter    */
  132.           /* Wait(diwstop_h-2, 0xff) */
  133. +       if (p->bplcon0 & BPC0_SHRES)
  134. + /*
  135. +  * htotal-4 is used in SHRES-mode, as diwstop_h-2 doesn't work under ECS.
  136. +  * Does this work under AGA?
  137. +  * -Jes
  138. +  */
  139. +         *cop++ = 0xff00 | ((p->htotal-4) | 1);
  140. +       else 
  141.               *cop++ = 0xff00 | ((diwstop_h-2) >> 1) | 0x1;
  142.               *cop++ = 0xfffe;
  143.           /* Wait(0, 0) - make sure we're in the new segment */
  144.               *cop++ = 0x0001;
  145.               *cop++ = 0xfffe;
  146.           line -= 256;
  147. + /*
  148. +  * Under ECS we have to keep color[0], as it is part of a special color-table.
  149. +  */
  150. +       if (boot_info.bi_amiga.chipset == CS_ECS && p->bplcon0 & BPC0_ECSENA) {
  151. +       *cop++ = 0x0180;
  152. +       *cop++ = ecs_color_zero;
  153. +     }
  154.           }
  155.       
  156.       /* Wait(diwstop_h, line - 1) */
  157. ***************
  158. *** 440,446 ****
  159.   
  160.           for (i = 0 ; i < p->scr_depth ; i++) {
  161.               scrmem = (long)p->bitplane[i];
  162. -         
  163.               if (shf)
  164.                   scrmem += p->bytes_per_row;
  165.   
  166. --- 486,491 ----
  167. ***************
  168. *** 499,505 ****
  169.           ((hs & 0x000001fe) << 15) | (hs & 0x00000001) | 
  170.           ((ve & 0x000000ff) << 8) | ((ve & 0x00000100) >> 7));
  171.          }
  172. !    }
  173.   
  174.   static void amicon_interrupt(struct intframe *fp, void *data)
  175.   {
  176. --- 544,551 ----
  177.           ((hs & 0x000001fe) << 15) | (hs & 0x00000001) | 
  178.           ((ve & 0x000000ff) << 8) | ((ve & 0x00000100) >> 7));
  179.          }
  180. !  }
  181.   
  182.   static void amicon_interrupt(struct intframe *fp, void *data)
  183.   {
  184. ***************
  185. *** 513,519 ****
  186.       * At least it goes awfully perculiar on my A500 without the following
  187.       * test. Not really in a position to test this hypothesis, so sorry
  188.       * for the slow scrolling, all you flicker-fixed souls
  189. !    */
  190.   
  191.      if (!(p->bplcon0 & BPC0_LACE) || (custom.vposr & 0x8000)) {
  192.          if (p->scroll_latch || p->cursor_latch)
  193. --- 559,565 ----
  194.       * At least it goes awfully perculiar on my A500 without the following
  195.       * test. Not really in a position to test this hypothesis, so sorry
  196.       * for the slow scrolling, all you flicker-fixed souls
  197. !     */
  198.   
  199.      if (!(p->bplcon0 & BPC0_LACE) || (custom.vposr & 0x8000)) {
  200.          if (p->scroll_latch || p->cursor_latch)
  201. ***************
  202. *** 555,562 ****
  203.          custom.color[0]  = 0;
  204.          custom.bplcon3   = save_bplcon3;
  205.          }
  206.          do_blank = 0;
  207. !    }
  208.   
  209.      if (do_unblank) {
  210.          custom.dmacon = DMAF_SETCLR | DMAF_RASTER | DMAF_SPRITE;
  211. --- 601,609 ----
  212.          custom.color[0]  = 0;
  213.          custom.bplcon3   = save_bplcon3;
  214.          }
  215.          do_blank = 0;
  216. !      }
  217.   
  218.      if (do_unblank) {
  219.          custom.dmacon = DMAF_SETCLR | DMAF_RASTER | DMAF_SPRITE;
  220. ***************
  221. *** 567,581 ****
  222.          custom.bplcon3   = save_bplcon3 | BPC3_LOCT;
  223.          custom.color[0]  = COLOR_LSB(p->bgcol);
  224.          custom.bplcon3   = save_bplcon3;
  225. !        }
  226.          do_unblank = 0;
  227. !    }
  228.   
  229.      vblank.done  = 1;
  230. ! }
  231.   
  232.   /* ====================================================================== */
  233.   
  234.   
  235.   /* display_init():
  236.    *
  237. --- 614,691 ----
  238.          custom.bplcon3   = save_bplcon3 | BPC3_LOCT;
  239.          custom.color[0]  = COLOR_LSB(p->bgcol);
  240.          custom.bplcon3   = save_bplcon3;
  241. !      }
  242. !       /* color[0] is set to ecs_color_zero under ECS */
  243. !       if (boot_info.bi_amiga.chipset == CS_ECS && p->bplcon0 & BPC0_ECSENA) {
  244. !            custom.color[0]  = ecs_color_zero;
  245. !       }
  246.          do_unblank = 0;
  247. !      }
  248.   
  249.      vblank.done  = 1;
  250. !  }
  251.   
  252.   /* ====================================================================== */
  253.   
  254. + void build_ecs_colors(ushort color1, ushort color2, ushort color3, 
  255. +                       ushort color4, ushort *table)
  256. + {
  257. + /*
  258. +  * This function calculates the special ECS color-tables needed when running
  259. +  * new screen-modes available under ECS. See the hardware reference manual
  260. +  * 3rd edition for details.
  261. +  * -Jes
  262. +  */
  263. + ushort  t;
  264. +         t = (color1 & 0x0ccc);
  265. +         table[0] = t;
  266. +         table[4] = t;
  267. +         table[8] = t;
  268. +         table[12] = t;
  269. +         t = t >> 2;
  270. +         table[0] = (table[0] | t);
  271. +         table[1] = t;
  272. +         table[2] = t;
  273. +         table[3] = t;
  274. +         t = (color2 & 0x0ccc);
  275. +         table[1] = (table[1] | t);
  276. +         table[5] = t;
  277. +         table[9] = t;
  278. +         table[13] = t;
  279. +         t = t >> 2;
  280. +         table[4] = (table[4] | t);
  281. +         table[5] = (table[5] | t);
  282. +         table[6] = t;
  283. +         table[7] = t;
  284. +         t = (color3 & 0x0ccc);
  285. +         table[2] = (table[2] | t);
  286. +         table[6] = (table[6] | t);
  287. +         table[10] = t;
  288. +         table[14] = t;
  289. +         t = t >> 2;
  290. +         table[8] = (table[8] | t);
  291. +         table[9] = (table[9] | t);
  292. +         table[10] = (table[10] | t);
  293. +         table[11] = t;
  294. +         t = (color4 & 0x0ccc);
  295. +         table[3] = (table[3] | t);
  296. +         table[7] = (table[7] | t);
  297. +         table[11] = (table[11] | t);
  298. +         table[15] = t;
  299. +         t = t >> 2;
  300. +         table[12] = (table[12] | t);
  301. +         table[13] = (table[13] | t);
  302. +         table[14] = (table[14] | t);
  303. +         table[15] = (table[15] | t);
  304. + }
  305. + /* ====================================================================== */
  306.   
  307.   /* display_init():
  308.    *
  309. ***************
  310. *** 585,592 ****
  311.   static void display_init(struct display *p,
  312.                            struct geometry *geom, ushort inverse)
  313.   {
  314. !    int i;
  315. !    char *chipptr;
  316.      ushort diwstrt_v, diwstop_v;
  317.      ushort diwstrt_h, diwstop_h;
  318.      ushort diw_min_h, diw_min_v;
  319. --- 695,703 ----
  320.   static void display_init(struct display *p,
  321.                            struct geometry *geom, ushort inverse)
  322.   {
  323. !    ushort ecs_table[16];
  324. !    int    i;
  325. !    char   *chipptr;
  326.      ushort diwstrt_v, diwstop_v;
  327.      ushort diwstrt_h, diwstop_h;
  328.      ushort diw_min_h, diw_min_v;
  329. ***************
  330. *** 616,621 ****
  331. --- 727,736 ----
  332.      p->fontheight     = fontheight;
  333.      p->fontwidth      = fontwidth;
  334.      p->bplcon0        = geom->bplcon0 | BPC0_COLOR;
  335. +    p->htotal         = geom->htotal;
  336. + /* htotal was added, as I use it to calc the pal-line. -Jes */
  337.      if (p->scr_depth < 8) {
  338.          p->bplcon0 |= (p->scr_depth << 12);
  339.          }
  340. ***************
  341. *** 668,678 ****
  342.          ddfstrt = (diwstrt_h >> 1) - 4;
  343.          ddfstop = ddfstrt + (4 * (p->bytes_per_row>>1)) - 8;
  344.          }
  345. !    else if (p->bplcon0 & BPC0_SHRES) {
  346.          /* There may be some interaction with FMODE here... -8 is magic. */
  347.          ddfstrt = (diwstrt_h >> 1) - 8;
  348.          ddfstop = ddfstrt + (2 * (p->bytes_per_row>>1)) - 8;
  349. !        }
  350.      else {
  351.          ddfstrt = (diwstrt_h >> 1) - 8;
  352.          ddfstop = ddfstrt + (8 * (p->bytes_per_row>>1)) - 8;
  353. --- 783,812 ----
  354.          ddfstrt = (diwstrt_h >> 1) - 4;
  355.          ddfstop = ddfstrt + (4 * (p->bytes_per_row>>1)) - 8;
  356.          }
  357. !    else if (p->bplcon0 & BPC0_SHRES && boot_info.bi_amiga.chipset == CS_AGA) {
  358.          /* There may be some interaction with FMODE here... -8 is magic. */
  359. +        /*
  360. +         * This shoud be fixed, so it supports all different FMODE's.
  361. +         * FMODE varies the speed with 1,2 & 4 the standard ECS speed.
  362. +         * Someone else has to do it, as I don't have an AGA machine with MMU
  363. +         * available here.
  364. +         *
  365. +         * This particular speed looks like FMODE = 3 to me.
  366. +         * ddfstop should be changed so it depends on FMODE under AGA.
  367. +         * -Jes
  368. +         */
  369.          ddfstrt = (diwstrt_h >> 1) - 8;
  370.          ddfstop = ddfstrt + (2 * (p->bytes_per_row>>1)) - 8;
  371. !      }
  372. !        /* 
  373. !         * Normal speed for ECS, should be the same for FMODE = 0
  374. !         * -Jes
  375. !         */
  376. !    else if (p->bplcon0 & BPC0_SHRES && boot_info.bi_amiga.chipset == CS_ECS){
  377. !        ddfstrt = (diwstrt_h >> 1) - 2;
  378. !        ddfstop = ddfstrt + (2 * (p->bytes_per_row>>1)) - 8;
  379. !      }
  380.      else {
  381.          ddfstrt = (diwstrt_h >> 1) - 8;
  382.          ddfstop = ddfstrt + (8 * (p->bytes_per_row>>1)) - 8;
  383. ***************
  384. *** 683,689 ****
  385.      else
  386.         cursorheight = p->fontheight;
  387.   
  388. !    chipptr = amiga_chip_alloc(p->scr_depth*p->plane_size+COP_MEM_REQ+SPR_MEM_REQ+4*(cursorheight-1));
  389.      
  390.      /* locate the bitplanes */
  391.      /* These MUST be 64 bit aligned for full AGA compatibility!! */
  392. --- 817,823 ----
  393.      else
  394.         cursorheight = p->fontheight;
  395.   
  396. !    chipptr = amiga_chip_alloc(p->scr_depth*(p->plane_size)+COP_MEM_REQ+SPR_MEM_REQ+4*(cursorheight-1));
  397.      
  398.      /* locate the bitplanes */
  399.      /* These MUST be 64 bit aligned for full AGA compatibility!! */
  400. ***************
  401. *** 702,713 ****
  402.   
  403.      /* create the sprite data for the cursor image */
  404.      memset((void *)p->cursor, 0, 8+4*cursorheight);
  405. !    if (p->bplcon0 & BPC0_ECSENA)
  406. !       /* AGA cursor is SHIRES */
  407.         for (i = 0; (i < p->fontwidth) && (i < 16); i++)
  408.            cursormask |= 1<<(15-i);
  409.      else
  410. !       /* OCS cursor is LORES */
  411.         for (i = 0; (i < p->fontwidth/2) && (i < 8); i++)
  412.            cursormask |= 1<<(15-i);
  413.   
  414. --- 836,850 ----
  415.   
  416.      /* create the sprite data for the cursor image */
  417.      memset((void *)p->cursor, 0, 8+4*cursorheight);
  418. !       /*
  419. !        * Only AGA supplies hires sprites.
  420. !        */
  421. !    if (p->bplcon0 & BPC0_ECSENA && boot_info.bi_amiga.chipset == CS_AGA)
  422. !       /* AGA cursor is SHIRES, ECS sprites differ */
  423.         for (i = 0; (i < p->fontwidth) && (i < 16); i++)
  424.            cursormask |= 1<<(15-i);
  425.      else
  426. !       /* For OCS & ECS sprites are pure LORES 8-< */
  427.         for (i = 0; (i < p->fontwidth/2) && (i < 8); i++)
  428.            cursormask |= 1<<(15-i);
  429.   
  430. ***************
  431. *** 758,763 ****
  432. --- 895,933 ----
  433.         custom.color[17] = COLOR_LSB(p->crsrcol);
  434.         custom.bplcon3   = geom->bplcon3;
  435.      }
  436. +    if (boot_info.bi_amiga.chipset == CS_ECS && p->bplcon0 & BPC0_ECSENA) {
  437. +       /*
  438. +        * Calculation of the special ECS color-tables for planes and sprites
  439. +        * is done in the function build_ecs_table
  440. +        */
  441. +       /*
  442. +        * Calcs a special ECS colortable for the bitplane, and copies it
  443. +        * to the custom registers
  444. +        */
  445. +       build_ecs_colors(COLOR_MSB(p->bgcol), COLOR_MSB(p->fgcol),
  446. +                                                        0, 0, ecs_table); 
  447. +       for (i = 0; i < 8; i++){
  448. +            custom.color[i]   = ecs_table[i*2];
  449. +            custom.color[i+8] = ecs_table[i*2+1];
  450. +       }
  451. +       ecs_color_zero = ecs_table[0];
  452. +       /*
  453. +        * Calcs a special ECS colortable for the cursor sprite, and copies it
  454. +        * to the appropriate custom registers
  455. +        */
  456. +       build_ecs_colors(0, COLOR_MSB(p->crsrcol), 0, 0, ecs_table);
  457. +       for (i = 0; i < 16; i++){
  458. +            custom.color[i+16] = ecs_table[i];
  459. +           }
  460. +       }
  461.      if (!(geom->isOCS)) {
  462.          /* Need to set up a bunch more regs */
  463.          /* Assumes that diwstrt is in the (0,0) sector, but stop might not be */
  464. ***************
  465. *** 782,789 ****
  466.          custom.vbstop    = geom->vbstop;
  467.          custom.hcenter    = geom->hcenter;
  468.          custom.beamcon0    = geom->beamcon0;
  469. !        custom.fmode    = geom->fmode;
  470.          /* We could load 8-bit colors here, if we wanted */
  471.          }
  472.   
  473. --- 952,961 ----
  474.          custom.vbstop    = geom->vbstop;
  475.          custom.hcenter    = geom->hcenter;
  476.          custom.beamcon0    = geom->beamcon0;
  477. !        if (boot_info.bi_amiga.chipset == CS_AGA) {
  478. !            custom.fmode    = geom->fmode;
  479. !           }
  480. !        /* fmode does NOT! excist under ECS, weird things might happen */
  481.          /* We could load 8-bit colors here, if we wanted */
  482.          }
  483.   
  484. ***************
  485. *** 904,909 ****
  486. --- 1076,1264 ----
  487.       704, 296,
  488.       0x5b, 0x18,
  489.       16                /* WORD aligned */
  490. +     },
  491. +     /* ECS modes, these are real ECS modes */
  492. +     {
  493. +     "multiscan", 0,
  494. +     BPC0_SHRES | BPC0_ECSENA,            /* bplcon0 */
  495. +     640, 480, 1,
  496. +     640, 480,
  497. +     0x0041, 0x002c,                    /* diwstrt h,v */
  498. +         64,                            /* 64-bit aligned */
  499. +     BPC2_KILLEHB,                    /* bplcon2 */
  500. +     BPC3_PF2OF1 | BPC3_PF2OF0 | BPC3_SPRES1 | BPC3_SPRES0 |
  501. +         BPC3_BRDRBLNK | BPC3_EXTBLKEN,        /* bplcon3 */
  502. +     0x0072,                        /* htotal */
  503. +     0x000a,                        /* hsstrt */
  504. +     0x0013,                        /* hsstop */
  505. +     0x0002,                        /* hbstrt */
  506. +     0x001c,                        /* hbstop */
  507. +     0x020c,                        /* vtotal */
  508. +     0x0008,                        /* vsstrt */
  509. +     0x0011,                        /* vsstop */
  510. +     0x0000,                        /* vbstrt */
  511. +     0x001c,                        /* vbstop */
  512. +     0x0043,                        /* hcenter */
  513. +     BMC0_VARVBEN | BMC0_LOLDIS | BMC0_VARVSYEN |
  514. +         BMC0_VARHSYEN | BMC0_VARBEAMEN | BMC0_BLANKEN,    /* beamcon0 */
  515. +     FMODE_BPAGEM | FMODE_BPL32            /* fmode */
  516. +     },
  517. +       {
  518. +     "multiscan-lace", 0,
  519. +     BPC0_SHRES | BPC0_LACE | BPC0_ECSENA,        /* bplcon0 */
  520. +     640, 960, 1,
  521. +     640, 960,
  522. +     0x0041, 0x002c,                    /* diwstrt h,v */
  523. +         64,                            /* 64-bit aligned */
  524. +     BPC2_KILLEHB,                    /* bplcon2 */
  525. +     BPC3_PF2OF1 | BPC3_PF2OF0 | BPC3_SPRES1 | BPC3_SPRES0 |
  526. +         BPC3_BRDRBLNK | BPC3_EXTBLKEN,        /* bplcon3 */
  527. +     0x0072,                        /* htotal */
  528. +     0x000a,                        /* hsstrt */
  529. +     0x0013,                        /* hsstop */
  530. +     0x0002,                        /* hbstrt */
  531. +     0x001c,                        /* hbstop */
  532. +     0x020c,                        /* vtotal */
  533. +     0x0008,                        /* vsstrt */
  534. +     0x0011,                        /* vsstop */
  535. +     0x0000,                        /* vbstrt */
  536. +     0x001c,                        /* vbstop */
  537. +     0x0043,                        /* hcenter */
  538. +     BMC0_VARVBEN | BMC0_LOLDIS | BMC0_VARVSYEN |
  539. +         BMC0_VARHSYEN | BMC0_VARBEAMEN | BMC0_BLANKEN,    /* beamcon0 */
  540. +     FMODE_BPAGEM | FMODE_BPL32            /* fmode */
  541. +     },
  542. +     /* Super 72 - 800x300 72Hz noninterlaced mode. */
  543. +     {
  544. +     "super72", 0,
  545. +     BPC0_SHRES | BPC0_ECSENA,            /* bplcon0 */
  546. +     800, 304, 1,                    /* need rows%8 == 0 */
  547. +     800, 304,                    /* (cols too) */
  548. +     0x0051, 0x0021,                    /* diwstrt h,v */
  549. +     64,                        /* 64-bit aligned */
  550. +     BPC2_KILLEHB,                    /* bplcon2 */
  551. +     BPC3_PF2OF1 | BPC3_PF2OF0 | BPC3_SPRES1 | BPC3_SPRES0 |
  552. +         BPC3_BRDRBLNK | BPC3_EXTBLKEN,        /* bplcon3 */
  553. +     0x0091,                        /* htotal */
  554. +     0x000a,                        /* hsstrt */
  555. +     0x0013,                        /* hsstop */
  556. +     0x0001,                        /* hbstrt */
  557. +     0x001e,                        /* hbstop */
  558. +     0x0156,                        /* vtotal */
  559. +     0x0009,                        /* vsstrt */
  560. +     0x0012,                        /* vsstop */
  561. +     0x0000,                        /* vbstrt */
  562. +     0x001c,                        /* vbstop */
  563. +     0x0052,                        /* hcenter */
  564. +     BMC0_VARVBEN | BMC0_LOLDIS | BMC0_VARVSYEN |
  565. +         BMC0_VARHSYEN | BMC0_VARBEAMEN | BMC0_BLANKEN,    /* beamcon0 */
  566. +     FMODE_BPAGEM | FMODE_BPL32            /* fmode */
  567. +     },
  568. +     /* Super 72 lace - 800x600 72Hz interlaced mode. */
  569. +     {
  570. +     "super72-lace", 0,
  571. +     BPC0_SHRES | BPC0_LACE | BPC0_ECSENA,        /* bplcon0 */
  572. +     800, 600, 1,                    /* need rows%8 == 0 */
  573. +     800, 600,                    /* (cols too) */
  574. +     0x0051, 0x0021,                    /* diwstrt h,v */
  575. +     64,                         /* 64-bit aligned */
  576. +     BPC2_KILLEHB,                    /* bplcon2 */
  577. +     BPC3_PF2OF1 | BPC3_PF2OF0 | BPC3_SPRES1 | BPC3_SPRES0 |
  578. +         BPC3_BRDRBLNK | BPC3_EXTBLKEN,        /* bplcon3 */
  579. +     0x0091,                        /* htotal */
  580. +     0x000a,                        /* hsstrt */
  581. +     0x0013,                        /* hsstop */
  582. +     0x0001,                        /* hbstrt */
  583. +     0x001e,                        /* hbstop */
  584. +     0x0150,                        /* vtotal */
  585. +     0x0009,                        /* vsstrt */
  586. +     0x0012,                        /* vsstop */
  587. +     0x0000,                        /* vbstrt */
  588. +     0x001c,                        /* vbstop */
  589. +     0x0052,                        /* hcenter */
  590. +     BMC0_VARVBEN | BMC0_LOLDIS | BMC0_VARVSYEN |
  591. +         BMC0_VARHSYEN | BMC0_VARBEAMEN | BMC0_BLANKEN,    /* beamcon0 */
  592. +     FMODE_BPAGEM | FMODE_BPL32            /* fmode */
  593. +     },
  594. +     /* DblNtsc - 640x400 59Hz noninterlaced mode. */
  595. +     {
  596. +     "dblntsc", 0,
  597. +     BPC0_SHRES | BPC0_ECSENA,            /* bplcon0 */
  598. +     640, 400, 1,                    /* need rows%8 == 0 */
  599. +     640, 400,                    /* (cols too) */
  600. +     0x0049, 0x0021,                    /* diwstrt h,v */
  601. +     64,                        /* 64-bit aligned */
  602. +     BPC2_KILLEHB,                    /* bplcon2 */
  603. +     BPC3_PF2OF1 | BPC3_PF2OF0 | BPC3_SPRES1 | BPC3_SPRES0 |
  604. +         BPC3_BRDRBLNK | BPC3_EXTBLKEN,        /* bplcon3 */
  605. +     0x0079,                        /* htotal */
  606. +     0x0007,                        /* hsstrt */
  607. +     0x0013,                        /* hsstop */
  608. +     0x0001,                        /* hbstrt */
  609. +     0x001e,                        /* hbstop */
  610. +     0x01ec,                        /* vtotal */
  611. +     0x0008,                        /* vsstrt */
  612. +     0x0010,                        /* vsstop */
  613. +     0x0000,                        /* vbstrt */
  614. +     0x0019,                        /* vbstop */
  615. +     0x0046,                        /* hcenter */
  616. +     BMC0_VARVBEN | BMC0_LOLDIS | BMC0_VARVSYEN |
  617. +         BMC0_VARHSYEN | BMC0_VARBEAMEN | BMC0_BLANKEN,    /* beamcon0 */
  618. +     FMODE_BPAGEM | FMODE_BPL32            /* fmode */
  619. +     },
  620. +     /* DblPal - 640x512 52Hz noninterlaced mode. */
  621. +     {
  622. +     "dblpal", 0,
  623. +     BPC0_SHRES | BPC0_ECSENA,            /* bplcon0 */
  624. +     640, 512, 1,                    /* need rows%8 == 0 */
  625. +     640, 512,                    /* (cols too) */
  626. +     0x0049, 0x0021,                    /* diwstrt h,v */
  627. +     64,                        /* 64-bit aligned */
  628. +     BPC2_KILLEHB,                    /* bplcon2 */
  629. +     BPC3_PF2OF1 | BPC3_PF2OF0 | BPC3_SPRES1 | BPC3_SPRES0 |
  630. +         BPC3_BRDRBLNK | BPC3_EXTBLKEN,        /* bplcon3 */
  631. +     0x0079,                        /* htotal */
  632. +     0x0007,                        /* hsstrt */
  633. +     0x0013,                        /* hsstop */
  634. +     0x0001,                        /* hbstrt */
  635. +     0x001e,                        /* hbstop */
  636. +     0x0234,                        /* vtotal */
  637. +     0x0008,                        /* vsstrt */
  638. +     0x0010,                        /* vsstop */
  639. +     0x0000,                        /* vbstrt */
  640. +     0x0019,                        /* vbstop */
  641. +     0x0046,                        /* hcenter */
  642. +     BMC0_VARVBEN | BMC0_LOLDIS | BMC0_VARVSYEN |
  643. +         BMC0_VARHSYEN | BMC0_VARBEAMEN | BMC0_BLANKEN,    /* beamcon0 */
  644. +     FMODE_BPAGEM | FMODE_BPL32            /* fmode */
  645. +     },
  646. +     /* Euro72 - productivity - 640x400 71Hz noninterlaced mode. */
  647. +     {
  648. +     "euro72", 0,
  649. +     BPC0_SHRES | BPC0_ECSENA,            /* bplcon0 */
  650. +     640, 400, 1,                    /* need rows%8 == 0 */
  651. +     640, 400,                    /* (cols too) */
  652. +     0x0041, 0x0021,                    /* diwstrt h,v */
  653. +     64,                        /* 64-bit aligned */
  654. +     BPC2_KILLEHB,                    /* bplcon2 */
  655. +     BPC3_PF2OF1 | BPC3_PF2OF0 | BPC3_SPRES1 | BPC3_SPRES0 |
  656. +         BPC3_BRDRBLNK | BPC3_EXTBLKEN,        /* bplcon3 */
  657. +     0x0071,                        /* htotal */
  658. +     0x0009,                        /* hsstrt */
  659. +     0x0013,                        /* hsstop */
  660. +     0x0001,                        /* hbstrt */
  661. +     0x001e,                        /* hbstop */
  662. +     0x01be,                        /* vtotal */
  663. +     0x0008,                        /* vsstrt */
  664. +     0x0016,                        /* vsstop */
  665. +     0x0000,                        /* vbstrt */
  666. +     0x001f,                        /* vbstop */
  667. +     0x0041,                        /* hcenter */
  668. +     BMC0_VARVBEN | BMC0_LOLDIS | BMC0_VARVSYEN |
  669. +         BMC0_VARHSYEN | BMC0_VARBEAMEN | BMC0_BLANKEN,    /* beamcon0 */
  670. +     FMODE_BPAGEM | FMODE_BPL32            /* fmode */
  671.       },
  672.       /* AGA modes */
  673.       {
  674.